home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 6 / The Arsenal Files 6 (Arsenal Computer).ISO / os2bbs / ftpfid16.zip / FTPMON.CMD < prev    next >
OS/2 REXX Batch file  |  1995-12-17  |  1KB  |  29 lines

  1. /* TEST   */
  2. New=Directory('f:bbs\logs')
  3.     
  4.     IF Stream('f:\bbs\logs\ftprpt.log','C', 'Query Exists') <>' ' Then
  5.     Do
  6.     rc = stream('f:\bbs\logs\ftprpt.log','C','open read')
  7.     total_sent = 0
  8.     total_rec = 0
  9.     total_time = 0
  10.     total_sec = 0
  11.      do until LINES('f:\bbs\logs\ftprpt.log') = 0
  12.       line = LINEIN('f:\bbs\logs\ftprpt.log')
  13.       parse var line dae mon yr sent stat sentmuch bytes dytes recmuch rest muchtime mo muchsec eee
  14.         total_sent = total_sent + sentmuch
  15.         total_rec = total_rec + recmuch
  16.         total_time = total_time + muchtime
  17.         total_sec = total_sec + muchsec
  18.         if total_sec > 59 then 
  19.           do
  20.         total_time = total_time + 1
  21.         total_sec = total_sec - 60
  22.           end
  23.          end
  24.        end /* Do Until */
  25.        rc = stream('f:\bbs\logs\ftprpt.log','C','close')
  26.        say date('N') 'Monthly Stats: 'total_sent 'sent - 'total_rec 'recieved'
  27.        say total_time%60 'hours or 'total_time 'minutes 'total_sec 'secs'
  28. 'pause'
  29.